#include"dict_sever.hpp"
#include"dictionary.hpp"
#include<string>
#include<memory>

int main(int argc,char* argv[])//只需要传入端口号
{
    if(argc!=2)
    {
        LOG(FATAL)<<"命令行参数错误";
        DIE(1);
    }

    std::shared_ptr<dictionary>dict_sptr=std::make_shared<dictionary>();
    uint16_t port=std::stoi(argv[1]);
    std::unique_ptr<UDPserver> ser_uptr=std::make_unique<UDPserver>([&dict_sptr](const std::string&word)->std::string{
        return dict_sptr->translate(word);
    },port);
    ser_uptr->InitServer();
    ser_uptr->start();
    

    return 0;
}